<admintpl file="header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="javascript:;">评分管理</a></li>
			<li><a href="{:U('edit')}" target="_self">添加评分</a></li>
		</ul>

		<form class="js-ajax-form" action="" method="post">

			<table class="table table-hover table-bordered table-list">
				<thead>
					<tr>
						<th width="20">id</th>
						<th width="80">标题</th>
						<th width="50">进行时间</th>
						<th width="50">状态</th>
						<th width="70">操作</th>
					</tr>
				</thead>
				<php>
				$status=array("1"=>"正常","0"=>"禁用");

				</php>
				
				<volist name='list' id='vo'>
					<tr>
						<td>{$vo.id}</td>
						<td>{$vo.title}</td>
						<td>
							<div>开始时间：{$vo.start_time}</div>
							<div>结束时间：{$vo.end_time}</div>
						</td>
						<td>{$vo.status}</td>
						<td>
							<a href="{:U('edit',['id'=>$vo[id]])}">编辑</a>
							<eq name='vo[status]' value='1'>
							
								<a href="{:U('setStatus',['id'=>$vo[id],'model'=>'rating','status'=>0])}">禁用</a>
								<else />
								<a href="{:U('setStatus',['id'=>$vo[id],'model'=>'rating','status'=>1])}">启用</a>
								
							</eq>
						</td>
					</tr>
				</volist>	

			</table>

			<div class="pagination">{$page}</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script>
		function refersh_window() {
			var refersh_time = getCookie('refersh_time');
			if (refersh_time == 1) {
				window.location = "{:U('AdminPost/index',$formget)}";
			}
		}
		setInterval(function() {
			refersh_window();
		}, 2000);
		$(function() {
			setCookie("refersh_time", 0);
			Wind.use('ajaxForm', 'artDialog', 'iframeTools', function() {
				//批量移动
				$('.js-articles-move').click(function(e) {
					var str = 0;
					var id = tag = '';
					$("input[name='ids[]']").each(function() {
						if ($(this).attr('checked')) {
							str = 1;
							id += tag + $(this).val();
							tag = ',';
						}
					});
					if (str == 0) {
						art.dialog.through({
							id : 'error',
							icon : 'error',
							content : '您没有勾选信息，无法进行操作！',
							cancelVal : '关闭',
							cancel : true
						});
						return false;
					}
					var $this = $(this);
					art.dialog.open("__ROOT__/index.php?g=portal&m=AdminPost&a=move&ids="+ id, {
						title : "批量移动",
						width : "80%"
					});
				});
			});
		});
	</script>
</body>
</html>